<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>

<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />

<script>

/////////////////通用部分 start
var Gbridge;

function connectWebViewJavascriptBridge(callback) {
	if (window.WebViewJavascriptBridge) {
		callback(WebViewJavascriptBridge);
	} else {
		document.addEventListener('WebViewJavascriptBridgeReady', function() {
			callback(WebViewJavascriptBridge);
		}, false)
	}
}


	connectWebViewJavascriptBridge(function(bridge) {
	Gbridge=bridge;
});



//获取url参数
function getQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]); return null;
}

/////////////通用部分 end


//显示商品详细信息
function showGoodsInfo(){
	var param={"productId":"123"};
	param=JSON.stringify(param);
	
	Gbridge.callHandler('clickProductRecommend',param,function(response) {});
}

//显示活动页面信息
function showActivityInfo(){
	
	var param={"productId":"123","produceWebURL":"http://m.baidu.com","productName":"空气盒子"};
	param=JSON.stringify(param);
	
	Gbridge.callHandler('clickActivityRecommend',param,function(response){});
}

</script>
</head>

<body>
<p>
<input type="button" value="打开活动页面" onClick="showActivityInfo()" />
</p>

<p>
	<input type="button" value="打开商品详细页面"  onClick="showGoodsInfo()" />
</p>

</body>
</html>
